#define DEBUG
#include <cstdio>

using namespace std;

int main() {
#ifdef DEBUG
  freopen("0.in", "r", stdin);
  freopen("0.out", "w", stdout);
#endif

  int n;
  scanf("%d", &n);
  if (n==4) {
    printf("1");
  } else if (n==6) {
    printf("6");
  } else {
    printf("0");
  }

  fclose(stdin);
  fclose(stdout);
  return 0;
}
